package org.file5.search;

import org.compass.core.converter.basic.AbstractBasicConverter;
import org.compass.core.mapping.ResourcePropertyMapping;
import org.compass.core.marshall.MarshallingContext;
import org.file5.domain.BaseEntity;

import com.googlecode.objectify.Key;



public class KeyConverter extends AbstractBasicConverter <Key<BaseEntity>> {
	protected Key<BaseEntity> doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) {
		return new Key<BaseEntity>(BaseEntity.class,str);
		}

	@Override
	protected String doToString(Key o,
			ResourcePropertyMapping resourcePropertyMapping,
			MarshallingContext context) {
		return o==null?"":o.getName();
	}
}
